/** PatientPanel **/

package docoffice.gui;

import java.awt.Color;
import java.awt.Dimension;
import java.awt.GridLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;

/**
 * @author George Chi
 * @version $Revision: 1.0 $
 */
public class PatientPanel extends JPanel {

	/**
	 * Field patientTitle.
	 */
	private final JLabel patientTitle;
	
	/**
	 * Field blank6.
	 */
	/**
	 * Field blank5.
	 */
	/**
	 * Field blank4.
	 */
	/**
	 * Field blank3.
	 */
	/**
	 * Field blank2.
	 */
	/**
	 * Field blank1.
	 */
	private final JLabel blank1, blank2, blank3, blank4, blank5, blank6;
	
	/**
	 * Field hist.
	 */
	/**
	 * Field appt.
	 */
	private final JButton appt, hist;

	/**
	 * Constructor for PatientPanel.
	 */
	public PatientPanel() {
		patientTitle = new JLabel("Patient Login");
		appt = new JButton("Make an Appointment");
		hist = new JButton("View History");
		
		blank1 = new JLabel();
		blank2 = new JLabel();
		blank3 = new JLabel();
		blank4 = new JLabel();
		blank5 = new JLabel();
		blank6 = new JLabel();
		
		appt.addActionListener(new ApptListener());
		
		hist.addActionListener(new HistListener());
		
		setLayout(new GridLayout(3, 3, 5, 10));
		add(blank1);
		add(patientTitle);
		add(blank2);
		add(blank3);
		add(appt);
		add(blank4);
		add(blank5);
		add(hist);
		add(blank6);
		
		setPreferredSize(new Dimension(500, 130));
		setBackground(Color.WHITE);
	}
	
	/**
	 * @author George Chi
	 */
	private class ApptListener implements ActionListener {
		/**
		 * Method actionPerformed.
		 * @param e ActionEvent
		
		 * @see java.awt.event.ActionListener#actionPerformed(ActionEvent) */
		public void actionPerformed(ActionEvent e) {
			System.out.println("Make an appointment was clicked");
			removeAll();
			revalidate();
			repaint();
			add(new MakeApptPanel());
			
		}

		/**
		 * Method toString.
		
		 * @return String */
		public String toString() {
			return "ApptListener []";
		}
		
	}

	/**
	 * @author George Chi
	 */
	private class HistListener implements ActionListener {
		/**
		 * Method actionPerformed.
		 * @param e ActionEvent
		
		 * @see java.awt.event.ActionListener#actionPerformed(ActionEvent) */
		public void actionPerformed(ActionEvent e) {
			System.out.println("View History was clicked");
		}
		
		/**
		 * Method toString.
		
		 * @return String */
		public String toString() {
			return "HistListener []";
		}
		
	}

	/**
	 * Method toString.
	
	 * @return String */
	public String toString() {
		return "PatientPanel [patientTitle=" + patientTitle + ", blank1="
				+ blank1 + ", blank2=" + blank2 + ", blank3=" + blank3
				+ ", blank4=" + blank4 + ", blank5=" + blank5 + ", blank6="
				+ blank6 + ", appt=" + appt + ", hist=" + hist + "]";
	}
	
}
